<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>课程表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
<style type="text/css">
	body {
		font-size: 10pt;
	}
	.icon {
		margin:10px;
		border: solid 2px gray;
		width: 160px;
		height: 180px;
		text-align: center;
		float: left;
	}
</style>
  </head>
  
   
  <body>
  <script type="text/javascript" src="../../js/jquery-3.3.1.js"></script>
  <script type="text/javascript" src="../../js/body.js"></script>
  <script type="text/javascript">
  	$(document).ready(function(){
  		$("td").not(".time").html("");
  		$.post("${pageContext.request.contextPath}/syllabus/findBySid",
  		{
  			term:getRealTerm()
  		},
  		function(data,status){
  			for(var i = 0; i < data.data.syllabusItems.length; i++)
  			{
  				$("td").each(function(){
  					if($(this).attr("id")==data.data.syllabusItems[i].course.time1 || $(this).attr("id")==data.data.syllabusItems[i].course.time2)
  					{
  						
  						$(this).html(data.data.syllabusItems[i].course.cname);
  					}
  				});
  			}
  		});
  		
  	});
  	
  	function ajaxSyllabusFindBySid2(term){
  		$("td").not(".time").html("");
  	    $.post("${pageContext.request.contextPath}/syllabus/findBySid",
    	{
    		term:term
    	},
		function(data,status){
			for(var i = 0; i < data.data.syllabusItems.length; i++)
			{
				$("td").each(function(){
					if($(this).attr("id")==data.data.syllabusItems[i].course.time1 || $(this).attr("id")==data.data.syllabusItems[i].course.time2)
					{
						$(this).html(data.data.syllabusItems[i].course.cname);
					}
				});
			}
		});
		
	}
  </script>
<span>
	我的课程
	<select id = "term" onchange="ajaxSyllabusFindBySid2(this.value)">
	</select>
</span>
<table id="syllabus" class="easyui-datagrid" style="width:800px;height:auto;" border="1">
	<thead>
		<tr>
			<th field="number" width="100">节次</th>
			<th field="week2" width="100">星期一</th>
			<th field="week3" width="100">星期二</th>
			<th field="week4" width="100">星期三</th>
			<th field="week5" width="100">星期四</th>
			<th field="week6" width="100">星期五</th>
			<th field="week7" width="100">星期六</th>
			<th field="week8" width="100">星期日</th>
		</tr>                          
	</thead>                           
	<tbody>                            
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;1<br>&nbsp;8:20-9:05</td>            
			<td id="11"></td>             
			<td id="12"></td>             
			<td id="13"></td>             
			<td id="14"></td>             
			<td id="15"></td>
			<td id="16"></td> 
			<td id="17"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;2<br>&nbsp;9:15-10:00</td>            
			<td id="21"></td>             
			<td id="22"></td>             
			<td id="23"></td>             
			<td id="24"></td>             
			<td id="25"></td>
			<td id="26"></td> 
			<td id="27"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;3<br>&nbsp;10:20-11:05</td>            
			<td id="31"></td>             
			<td id="32"></td>             
			<td id="33"></td>             
			<td id="34"></td>             
			<td id="35"></td>
			<td id="36"></td> 
			<td id="37"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;4<br>&nbsp;11:15-12:00</td>            
			<td id="41"></td>             
			<td id="42"></td>             
			<td id="43"></td>             
			<td id="44"></td>             
			<td id="45"></td>
			<td id="46"></td> 
			<td id="47"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;5<br>&nbsp;14:00-14:45</td>            
			<td id="51"></td>             
			<td id="52"></td>             
			<td id="53"></td>             
			<td id="54"></td>             
			<td id="55"></td>
			<td id="56"></td> 
			<td id="57"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;6<br>&nbsp;14:55-15:40</td>            
			<td id="61"></td>             
			<td id="62"></td>             
			<td id="63"></td>             
			<td id="64"></td>             
			<td id="65"></td>
			<td id="66"></td> 
			<td id="67"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;7<br>&nbsp;15:50-16:35</td>            
			<td id="71"></td>             
			<td id="72"></td>             
			<td id="73"></td>             
			<td id="74"></td>             
			<td id="75"></td>
			<td id="76"></td> 
			<td id="77"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;8<br>&nbsp;16:45-17:30</td>            
			<td id="81"></td>             
			<td id="82"></td>             
			<td id="83"></td>             
			<td id="84"></td>             
			<td id="85"></td>
			<td id="86"></td> 
			<td id="87"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;9<br>&nbsp;19:00-19:45</td>            
			<td id="91"></td>             
			<td id="92"></td>             
			<td id="93"></td>             
			<td id="94"></td>             
			<td id="95"></td>
			<td id="96"></td> 
			<td id="97"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;10<br>&nbsp;19:55-20:40</td>            
			<td id="101"></td>             
			<td id="102"></td>             
			<td id="103"></td>             
			<td id="104"></td>             
			<td id="105"></td>
			<td id="106"></td> 
			<td id="107"></td>              
		</tr>
		<tr>  			                      
			<td class="time">&emsp;&emsp;&nbsp;11<br>&nbsp;20:50-21:35</td>            
			<td id="111"></td>             
			<td id="112"></td>             
			<td id="113"></td>             
			<td id="114"></td>             
			<td id="115"></td>
			<td id="116"></td> 
			<td id="117"></td>              
		</tr>
		
		                 
	</tbody>                           
</table>

  </body>
 
</html>

